/*
 * 原版接口
 */
import * as server from "@minecraft/server";
/*
 * 蛋白石组件
 */
import * as derived_tools from "../system/derived_tools";
import * as native_tools from "../system/native_tools";
/**
 * * 回收 渊鲸潜艇
 * 
 * @param {server.Entity} entity - 发起事件的实体对象
 */
export function WhaleRecycling(entity: server.Entity) {
    /** 
     * * 武装召集
     */
    const item = new server.ItemStack('item_armament:call_whale_support');
    /**
     * * 获取 玩家
     */
    const player = server.world.getEntity(entity.getDynamicProperty('entity:contract_user') as string);
    /**
     * * 获取 玩家背包
     */
    const container = player?.getComponent('inventory')?.container;
    // 删除 渊鲸潜艇
    if (player) derived_tools.UnloadInventoryAndPackage(entity, player as server.Player, item, '§l§q载具回收§r - ', []);
    // 删除 控制器物品
    if (container) native_tools.DeleteItemStack(container, new server.ItemStack('item_prop:mechanized_operation'));
};
/**
 * * 森蚺哨兵 - 回收
 * 
 * @param {server.Entity} entity - 发起事件的实体对象
 */
export function PythonRecycling(entity: server.Entity) {
    /** 
     * * 武装召集
     */
    const item = new server.ItemStack('item_armament:call_python_sentinel');
    /**
     * * 获取 玩家
     */
    const player = server.world.getEntity(entity.getDynamicProperty('entity:contract_user') as string);
    // 删除 森蚺哨兵
    if (player) derived_tools.UnloadInventoryAndPackage(entity, player as server.Player, item, '§l§q武器回收§r - ', []);
};